<template>
  <div class="users-container">
    <div v-for="(item,index) in list" :key="index">
      <NuxtLink :to="`/users-${item.name}/${item.phone}`">{{ item.name }}</NuxtLink>
    </div>
    <el-divider />
    <div class="wn-list">
      <div
          v-for="(item,index) in wn_list"
          :key="index"
          class="wn-l-item"
      >
        {{ item['wn_time'] }} - {{ item['wn_num'] }}
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
const list = [
  {name: '江小安', phone: '19908176330'},
  {name: '王小虎', phone: '19920817633'},
]
const config = useRuntimeConfig()
const { data, error, refresh } = await useAsyncData(
    'mountains',
    () => $fetch('/api/wnHistoryRecord', {
      baseURL: config.public.apiBase,
      body: {
        name: 'wangli',
      },
      method: 'post',
    })
)
const wn_list = JSON.parse(JSON.stringify(data.value))['data']['wn']
</script>

<style scoped lang="scss">
.users-container{
  .wn-list{
    .wn-l-item{
      margin-bottom: 10px;
      border: 1px solid #f1f2f3;
      padding: 5px;
    }
  }
}
</style>
